package com.chenlonghai.sbmybatis.service.impl;



import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.chenlonghai.sbmybatis.dao.CasesDao;
import com.chenlonghai.sbmybatis.entity.Cases;
import com.chenlonghai.sbmybatis.service.HoldingsService;

@Service
public class HoldingsServiceImpl implements HoldingsService {

	@Autowired
	private CasesDao casesDao;
	@Override
	public List<Cases> queryCases() {
		// TODO Auto-generated method stub
		return casesDao.queryCases();
	}

	@Override
	public Cases queryCasesBy(int id) {
		// TODO Auto-generated method stub
		return casesDao.queryCasesBy(id);
	}

	@Transactional
	@Override
	public boolean insertCase(Cases cases){
		// TODO Auto-generated method stub
		
		int  rowNum = casesDao.insertCase(cases);
		if (rowNum > 0) {
			return true;
		}

		return false;
	}

	@Override
	public boolean updateCase(Cases cases){


		return casesDao.updateCase(cases) >0;
	}

	@Override
	public boolean deleteCase(int id){

		return casesDao.deleteCase(id) >0;
	}

}
